<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	  xmlns:ui="http://java.sun.com/jsf/facelets"
	  xmlns:c="http://java.sun.com/jsp/jstl/core"
	  xmlns:f="http://java.sun.com/jsf/core"
	  xmlns:h="http://java.sun.com/jsf/html"
	  xmlns:dailymarket="http://dailymarket.com/facelets" >
	<head><title>IGNORED</title></head>
	<body>
		<f:metadata>
			<f:event type="preRenderView" listener="#{dealView.preRenderView}" />
			<f:viewParam name="cat" value="#{dealView.categoryID}" />
			<f:viewParam name="sort" value="#{dealView.sortMacro}" />
			<f:viewParam name="page" value="#{dealView.page}" />
			<f:viewParam name="count" value="#{dealView.count}" />
			<f:viewParam name="q" value="#{dealView.searchQuery}" />
			<f:viewParam name="partner" value="#{dealView.filterCompany}" />
		</f:metadata>
		<ui:composition template="templates/layout.xhtml">
			<ui:define name="windowTitle">Daily Market | Today's Deals</ui:define>
			<ui:define name="content">
				<div id="category_content" class="graphic_bg">
					<h:outputText style="font-weight: bold; font-size: 16px;" value="Categories" />
					<a class="category-box" href="#{dealView.buildRestLink('cat', catView.viewCategory.parentID)}">
						<h:graphicImage library="images/icons/16" name="folder_up.png" alt="f" />
						<h:outputText style="line-height: 16px; margin-left: 3px;" value="Up" />
					</a>
					<c:forEach items="#{catView.categoryList}" var="category">
						<a class="category-box" href="#{dealView.buildRestLink('cat', category.ID)}">
							<h:graphicImage library="images/icons/16" name="folder.png" alt="f" />
							<h:outputText style="line-height: 16px; margin-left: 3px;" value="#{category.name}" />
						</a>
					</c:forEach>
				</div>
				<div id="deals_content" class="graphic_bg">
					<h:form>
						<h:messages globalOnly="true" styleClass="form-messages" fatalClass="form-messages error" errorClass="form-messages error" warnClass="form-messages warn" infoClass="form-messages" />
						<div class="form-row header">Deals</div>
						<div class="form-row">
							<dailymarket:dealtitle />
						</div>
						<h:panelGroup rendered="#{dealView.renderable}" >
							<a href="#{dealView.buildRestLink('sort', 'newest')}" class="#{dealView.buildSortTabStyle('newest')}">Newest</a>
							<a href="#{dealView.buildRestLink('sort', 'ending')}" class="#{dealView.buildSortTabStyle('ending')}">Ending Soon</a>
							<a href="#{dealView.buildRestLink('sort', 'price_asc')}" class="#{dealView.buildSortTabStyle('price_asc')}">Lowest Price</a>
							<a href="#{dealView.buildRestLink('sort', 'price_desc')}" class="#{dealView.buildSortTabStyle('price_desc')}">Highest Price</a>
						</h:panelGroup>
						<h:dataTable rendered="#{dealView.renderable}" value="#{dealView.renderedModel}" var="curDeal" style="border: solid 4px #FFFFFF; border-collapse: collapse; width: 100%;" rowClasses="odd-row, even-row" headerClass="header-row" columnClasses="img-col,data-col,deal-timer-col">
							<h:column><a href="deal.do?deal=#{curDeal.ID}" style="display: block; width: 100px; height: 100px;"><img src="#{curDeal.findDefaultImageUrl(100)}" alt="#{curDeal.shortDesc}" title="#{curDeal.shortDesc}" /></a></h:column>
							<h:column>
								<a href="deal.do?deal=#{curDeal.ID}" class="table-link"><h:outputText style="font-weight: bold; font-size: 18px;" value="#{curDeal.shortDesc}" /></a><br/><h:outputText value="#{curDeal.companyDisplay}" title="#{curDeal.companyDisplay}" /><h:outputText styleClass="deal-pricetag" value="#{curDeal.priceDisplay}" /><h:outputText style="font-size: 12px;" value="#{curDeal.longDesc}" />
							</h:column>
							<h:column>
								<h:outputText value="#{curDeal.timeLeftDisplay}" style="#{curDeal.timeLeftStyle}" />
							</h:column>
						</h:dataTable>
						<h:panelGroup rendered="#{dealView.renderable}">
							<div class="page-nav">
								<dailymarket:dealpaginator showPages="10" selectedStyleClass="page-nav-link-sel" styleClass="page-nav-link" />
							</div>
						</h:panelGroup>
						<h:outputText styleClass="#{dealView.noneAlertStyle}" rendered="#{not dealView.renderable}" value="#{dealView.humanReadableNoneDescription}" />
					</h:form>
				</div>
			</ui:define>
		</ui:composition>
	</body>
</html>
